package com.djf.djfcs.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * Canal配置属性类
 */
@Data
@Component
@ConfigurationProperties(prefix = "canal")
public class CanalProperties {
    
    /**
     * Canal服务器配置
     */
    private Server server = new Server();
    
    /**
     * 目标实例名称
     */
    private String destination = "example";
    
    /**
     * 用户名
     */
    private String username = "";
    
    /**
     * 密码
     */
    private String password = "";
    
    /**
     * 批量大小
     */
    private int batchSize = 1000;
    
    /**
     * 超时时间
     */
    private long timeout = 1000;
    
    /**
     * 时间单位
     */
    private int unit = 3;
    
    @Data
    public static class Server {
        /**
         * Canal服务器主机
         */
        private String host = "localhost";
        
        /**
         * Canal服务器端口
         */
        private int port = 11111;
    }
}